feat(util-genai): refactor and make API smaller and more user-friendly#4391
Open
lmolkova wants to merge 15 commits intoopen-telemetry:mainfrom
Open
feat(util-genai): refactor and make API smaller and more user-friendly#4391lmolkova wants to merge 15 commits intoopen-telemetry:mainfrom
lmolkova wants to merge 15 commits intoopen-telemetry:mainfrom
Conversation
720ba87 to
23e777f
Compare
lmolkova
commented
Apr 3, 2026
lmolkova
commented
Apr 3, 2026
lmolkova
commented
Apr 3, 2026
0fc33e7 to
b8e7e4e
Compare
MikeGoldsmith
approved these changes
Apr 3, 2026
Member
MikeGoldsmith
left a comment
There was a problem hiding this comment.
Looks good to me. I've left one small suggestion for separating invocation types file, but not blocking.
I see you have a few TODOs you'd like to probably resolve before merging too.
util/opentelemetry-util-genai/src/opentelemetry/util/genai/types.py
Outdated
Show resolved
Hide resolved
DylanRussell
reviewed
Apr 3, 2026
util/opentelemetry-util-genai/src/opentelemetry/util/genai/tool_invocation.py
Outdated
Show resolved
Hide resolved
Member
Author
|
@MikeGoldsmith and @DylanRussell thanks for the review! The todos are the existing ones - it's easy to a address them but I didn't want to include any new features into this pure refactoring PR. |
DylanRussell
approved these changes
Apr 3, 2026
Kludex
reviewed
Apr 4, 2026
Kludex
reviewed
Apr 4, 2026
util/opentelemetry-util-genai/src/opentelemetry/util/genai/inference_invocation.py
Outdated
Show resolved
Hide resolved
util/opentelemetry-util-genai/src/opentelemetry/util/genai/inference_invocation.py
Outdated
Show resolved
Hide resolved
...ry-instrumentation-langchain/src/opentelemetry/instrumentation/langchain/callback_handler.py
Outdated
Show resolved
Hide resolved
392ae45 to
39ffa9d
Compare
keith-decker
reviewed
Apr 6, 2026
keith-decker
approved these changes
Apr 6, 2026
Member
Author
|
/cc @Cirilla-zmh |
MikeGoldsmith
approved these changes
Apr 8, 2026
Member
MikeGoldsmith
left a comment
There was a problem hiding this comment.
Still looks good but has some conflicts that need resolving first.
4d4e31d to
320bfd0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces the
handler.start_llm(invocation) / handler.stop_llm(invocation)pattern with factory methods that construct and start spans in one call, and moves lifecycle ownership onto the invocation object. Existing code continues to work —LLMInvocation,stop_llm, andfail_llmare kept with@deprecatedmarkers.Before
After